module.exports = function(grunt) {

  //配置参数
  grunt.initConfig({
     pkg: grunt.file.readJSON('package.json'),
     
	 //js合并
     concat: {
         options: {
             separator: ';',
             stripBanners: true
         },
         dist: {
           files: [			   
               {
			       src: [
                        'src/coms.js',
                        'src/doms.js',
						'src/dates.js',
	     				'src/strings.js',
						'src/funs.js',
						'src/jsFun.js',
					],
			    	dest: "static/jsFun.js"
			   },
            ]
         }
     },
 
	 //采用UglifyJS压缩js 
     uglify: {
         options: {
			 mangle: true, //混淆变量名
             comments: 'false' //false（删除全部注释），some（保留@preserve @license @cc_on等注释）
         },
         dist: {
             files: {				 
                 'static/jsFun.min.js': 'static/jsFun.js',
                 'doc/jsFun.min.js': 'static/jsFun.js',
             }
         }
     },
  });

  //载入concat和uglify插件，分别对于合并和压缩
  grunt.loadNpmTasks('grunt-contrib-concat');
  grunt.loadNpmTasks('grunt-contrib-uglify');
 // grunt.loadNpmTasks('grunt-contrib-cssmin');

  //注册任务 , 
  grunt.registerTask('default', ['concat','uglify']);
}